// 引入vue
import Vue from 'vue'

// 引入router
import VueRouter from 'vue-router'

// 引入组件
import Enroll from '../view/enroll'
import List from '../view/list'
import Login from '../view/login'
import Word from '../view/word'
import NotFound from '@/view/NotFound'

// 使用
Vue.use(VueRouter)

// 创建一个新的实例
const router = new VueRouter({
  // 去#号
  mode:'history',
  routes: [
  // 重定向
    {
      path: '/',
      redirect:'/login',
  },
    {
      path: '/enroll',
      component:Enroll,
    },
    {
      path: '/enroll/:name/:age',
      component:Enroll,
    },
    {
      path: '/list',
      component:List,
    },
    {
      path: '/login',
      component:Login,
    },
    {
      path: '/word',
      component:Word,
    },
    {
      path: '*',
      component:NotFound,
    }
  ],
  linkActiveClass: 'aa',
  linkExactActiveClass: 'aa',
})

// 导出
export default router